package com.ibigcat.module.mdm.dao.mapper;

import java.util.*;

import com.ibigcat.framework.common.pojo.PageResult;
import com.ibigcat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ibigcat.framework.mybatis.core.mapper.BaseMapperX;
import com.ibigcat.module.mdm.dao.entity.CommoditySetGroupDO;
import org.apache.ibatis.annotations.Mapper;
import com.ibigcat.module.mdm.controller.admin.commoditysetgroup.vo.*;

/**
 * 组套商品管理明细 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CommoditySetGroupMapper extends BaseMapperX<CommoditySetGroupDO> {

    default PageResult<CommoditySetGroupDO> selectPage(CommoditySetGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CommoditySetGroupDO>()
                .eqIfPresent(CommoditySetGroupDO::getGroupId, reqVO.getGroupId())
                .eqIfPresent(CommoditySetGroupDO::getCommodityId, reqVO.getCommodityId())
                .eqIfPresent(CommoditySetGroupDO::getQuantity, reqVO.getQuantity())
                .betweenIfPresent(CommoditySetGroupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CommoditySetGroupDO::getId));
    }

}